//
//  QuotaVC.swift
//  LeGou
//
//  Created by 刘亿前 on 2022/10/11.
//

import UIKit
import LTScrollView

class QuotaVC: ZMViewController {

    private lazy var layout: LTLayout = {
        let layout = LTLayout()
        layout.titleViewBgColor = .white
        layout.titleSelectColor = Style.mainColor
        layout.bottomLineColor = Style.mainColor
        layout.pageBottomLineColor = .clear
        layout.titleColor = UIColor.zm.color(hexString: "#333333")
        layout.sliderWidth = 24
        layout.isNeedScale = false
        layout.isAverage = true
        layout.titleFont = UIFont.zm.fontMedium(size: 16)
        layout.showsHorizontalScrollIndicator = false
        return layout
    }()
        
    private lazy var controllers: [QuotaListVC] = {
        var arr = [QuotaListVC]()
        for i in 0 ..< titles.count {
            let vc = QuotaListVC()
            vc.index = i
            arr.append(vc)
        }
        return arr
    }()
    
    private let titles = ["已发放额度","待发放额度"]
    
    private lazy var advancedManager: LTAdvancedManager = {
        let manager = LTAdvancedManager(frame: CGRect(x: 0, y: 0, width: SCREEN_W, height: SCREEN_H), viewControllers: controllers, titles: titles, currentViewController: self, layout: layout, headerViewHandle: {
            return UIView()
        })
        manager.backgroundColor = .clear
        return manager
    }()
    
    var spread = false
    var index = 0
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "推广额度"
        view.addSubview(advancedManager)
        advancedManager.scrollToIndex(index: index)
        setRightCustomBtn(titleStr: "发放规则", color: "#333333".zm.hex(), font: UIFont.zm.fontRegular(size: 14)) { sender in
            CommonService.shared.goWeb(type: .quotaRule)
        }
    }

}
